package org.example.admin.service.impl;


import org.apache.ibatis.annotations.Param;
import org.example.admin.mapper.OrdersMapper;
import org.example.admin.service.OrdersService;
import org.example.entity.OrdersAndAddress;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrdersServiceImpl implements OrdersService {

    private OrdersMapper ordersMapper;

    public OrdersServiceImpl(OrdersMapper ordersMapper) {
        this.ordersMapper = ordersMapper;
    }
    //联表查询订单和订单地址
    @Override
    public List<OrdersAndAddress> getPageOrders(Integer offset, Integer limit) {
        List<OrdersAndAddress> pageOrders = ordersMapper.getPageOrders(offset, limit);
        return pageOrders;

    }

    //修改订单地址
    @Override
    public int update(String ono, String AddressNew) {
       return ordersMapper.update(ono,AddressNew);
    }


}
